package com.klei.service.impl;

import com.klei.dao.IMyOrdersDao;
import com.klei.pojo.MyOrders;
import com.klei.service.IMyOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyOrdersServiceImpl implements IMyOrdersService {

    @Autowired
    private IMyOrdersDao myOrdersDao;

    @Override
    public List<MyOrders> getMyOrders(int uid) {
        return myOrdersDao.getMyOrders(uid);
    }

    @Override
    public List<MyOrders> getMyOrdersByPage(int uid, int page, int limit) {
        return myOrdersDao.getMyOrdersByPage(uid, page, limit);
    }

    @Override
    public int getMyOrdersCount(int uid) {
        return myOrdersDao.getMyOrdersCount(uid);
    }

    @Override
    public boolean deleteMyOrder(int id) {
        return myOrdersDao.deleteMyOrder(id) > 0;
    }

}
